<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
%>
<jsp:include page="/top.jsp"></jsp:include>

	<script type="text/javascript" src="<%=path %>/content/xheditor/xheditor-zh-cn.min.js?v=1.1.2"></script>
    <script type="text/javascript">
    $(pageInit);
    function pageInit()
    {
        $('#elm1').xheditor({upLinkUrl:"<%=path %>/xheditor/editorUpload.action",upLinkExt:"zip,rar,txt",upImgUrl:"<%=path %>/xheditor/editorUpload.action",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"<%=path %>/xheditor/editorUpload.action",upFlashExt:"swf",upMediaUrl:"<%=path %>/xheditor/editorUpload.action",upMediaExt:"wmv,avi,wma,mp3,mid",onUpload:insertUpload,shortcuts:{'ctrl+enter':submitForm}});
        $('#comment').xheditor({upLinkUrl:"<%=path %>/xheditor/editorUpload.action",upLinkExt:"zip,rar,txt",upImgUrl:"<%=path %>/xheditor/editorUpload.action",upImgExt:"jpg,jpeg,gif,png",onUpload:insertUpload,shortcuts:{'ctrl+enter':submitForm}});
    }
    function insertUpload(arrMsg)
    {
        var i,msg;
        for(i=0;i<arrMsg.length;i++)
        {
            msg=arrMsg[i];
            $("#uploadList").append('<option value="'+msg.url+'">'+msg.url+'</option>');
        }
    }
    function submitForm(){$('#form').submit();}
    </script>

	<!--内容区 开始 -->
	<div id="content" class="subcontainer fleft">
		<div class="breadcrumb"> <a href="<%=path%>/index">首页</a> &raquo; <a href="#">发表通知</a> </div>
	    <!--评论列表 开始-->
    <div id="comments">
       <!--发表评论 开始-->
      <div id="respond">
        <h2 class="mainhead">发表通知</h2>
        <div class="cancel-comment-reply"> <a rel="nofollow" id="cancel-comment-reply-link" href="/wordpress/?p=552#respond" style="display:none;">Cancel</a> </div>
        <form id="form" action="<%=path %>/notice/addNotice" method="post" id="commentform">
			<p>
				<input type="text" title="通知标题" name="noticeDto.title" class="text" />
			</p>
            <p>
            <c:choose>
                <c:when test="${nts != null}">
                    <select name="noticeDto.type" class="reg">
                            <c:forEach items="${nts}" var="type" ><option value="${type.id}">${type.name}</option></c:forEach>
                    </select>
                </c:when>
                <c:otherwise>
                    没有类型，<a href="<%=path %>/noticetype/goAddNoticeType">新建类型</a>
                </c:otherwise>
            </c:choose>
            <select name="noticeDto.isCmsAllow" class="reg">
				<option value="1">允许评论</option>
                <option value="0">不允许评论</option>
            </select>
			</p>
			<p>
				<textarea name="noticeDto.content" title="通知内容..." id="comment" cols="100%" rows="10" ></textarea>
			</p>
			<p>
				已上传的图片列表：<select id="uploadList" class="reg"></select>
			</p>
			<div class="clear"></div>
			<p>
				<input name="submit" type="submit" class="submit2" value="添加" />
			</p>
        <div class="clear"></div>
        </form>
      </div>
       <!--发表评论 结束-->
    </div>
    <!--评论列表 结束-->
	</div>
	<!--内容区 结束 -->

<jsp:include page="/bottom.jsp"></jsp:include>